
#ifndef DRV_DISP_ALG_SERVICE_H
#define DRV_DISP_ALG_SERVICE_H
#include "hi_type.h"
#include "hi_drv_disp.h"
#include <linux/string.h>


#define V0 0
#define V1 1
#define  MAX_ALG_SUPPORT_NUM  WINDOW_MAX_NUMBER

typedef struct hiAlgInfor_s{
    HI_S32   x_start;
    HI_U32 u32OrigPos;
}AlgInfor_s;

typedef struct hiWindowZorderInfor_s{
    /*input param*/
    HI_U16      winZorder;
    HI_U16      layerNumber;

    HI_U32      layerZorder;
    /*output param.*/
    HI_DRV_DISP_ZORDER_E   matchOperation;
}WindowZorderInfor_S;


typedef struct hiWindowInfor_S{
    HI_U16   x_start;
    HI_U16   x_end;

    HI_U16   y_start;
    HI_U16   y_end;

    /*the zorder is a input param.*/
    HI_U16   zorder;
    HI_U32  u32VideoLayer;
}WindowInfor_S;

typedef struct hiWindowMappingResult_S{
    /* videolayer and regionNo are output params.*/
    HI_U16 videoLayer;
    HI_U16 regionNo;
    HI_U32 u32OverlapCnt;
}WindowMappingResult_S;

typedef struct hiWinMap2LayerInfor_S
{
    WindowInfor_S  stInputWinCoordinateInfor[WINDOW_MAX_NUMBER];
    WindowZorderInfor_S stInputWinZorderInfor[WINDOW_MAX_NUMBER];
    WindowMappingResult_S stWinMappingResult[WINDOW_MAX_NUMBER];
}WinMap2LayerInfor_S;

HI_S32 WindowAndLayerMapping( WindowInfor_S *winCoordinate,
                              WindowMappingResult_S *winMappingResult,
                              HI_U32 numofWindow);
HI_S32 layerZorderMatch( WindowZorderInfor_S *winZorderInfor,
                         HI_U32  numofWindow);
#endif
